﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Windows;

namespace QLKS.ViewModels
{
    static public class TienTeViewModel
    {
        static public DataTable GetDmTienTe()
        {
             DataTable tb = new DataTable();
             tb = Models.TienTeModel.GetDmTienTe();
             return tb;
        }

         //Tạo mới tiền tệ
        static public DataTable CreateNewTienTe()
        {
            DataTable tb = new DataTable();
            tb = Models.TienTeModel.CreateNewTienTe();
            return tb;
        }
        //thêm tiền tệ
        static public bool ThemTienTe(DataTable tb)
        {
            try
            {
                Models.TienTeModel.ThemTienTe(tb);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HotelManager", MessageBoxButton.OK, MessageBoxImage.Error);
                if (Models.DataProviderModel.IsOpen)
                    Models.DataProviderModel.Close();
                return false;
            }
            return true;
        }
    }
}
